//
//  MyTakingViewController.m
//  LineMoney
//
//  Created by 尹宁 on 16/7/22.
//  Copyright © 2016年 范琦. All rights reserved.
//

#import "MyTakingViewController.h"
#import "MainSectionView.h"
#import "ScoreHistoryView.h"
#import "ScoreExchangeView.h"
@interface MyTakingViewController ()


@property (nonatomic, strong) UIView *bigView;
@property (nonatomic, strong) MainSectionView *sectionView1;
@property (nonatomic, strong) MainSectionView *sectionView2;
@property (nonatomic, strong) ScoreHistoryView *score;
@property (nonatomic, strong) ScoreExchangeView *exchange;
@end

@implementation MyTakingViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.title = @"我的利润";
//    self.view.backgroundColor = [UIColor whiteColor];
    [self creatBigView];
    [self creatSectionView];
    [self creatScoreHistory];
    [self creatScoreExchange];
}

- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    self.navigationController.navigationBarHidden = NO;
    self.tabBarController.tabBar.hidden = YES;
//    self.view.backgroundColor = [UIColor whiteColor];
    
}

- (void)creatBigView
{
    _bigView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, KSCREENWIDTH, KSCREENHEIGHT)];
//    _bigView.backgroundColor = [UIColor whiteColor];
    _bigView.backgroundColor = HUIBACKGROUNDCOLOR;
    [self.view addSubview:_bigView];
}

- (void)creatSectionView
{
    
    self.sectionView1 = [[[NSBundle mainBundle] loadNibNamed:@"MainSectionView" owner:nil options:nil] lastObject];
    _sectionView1.frame = CGRectMake(0, 0, KSCREENWIDTH, 40);
    _sectionView1.backgroundColor = [UIColor clearColor];
    _sectionView1.leftView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"小标题前竖条"]];
    _sectionView1.label.textColor = BACKGROUNDCOLOR;
    _sectionView1.label.text = @"点数积分历史";
    _sectionView1.imageV.hidden = YES;
    _sectionView1.label.backgroundColor = [UIColor clearColor];
    [_bigView addSubview:_sectionView1];
    
    
    self.sectionView2 = [[[NSBundle mainBundle] loadNibNamed:@"MainSectionView" owner:nil options:nil] lastObject];
    [_bigView addSubview:_sectionView2];
    _sectionView2.frame = CGRectMake(0, 310, KSCREENWIDTH, 40);
    _sectionView2.backgroundColor = [UIColor clearColor];
    _sectionView2.leftView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"小标题前竖条"]];
    _sectionView2.label.textColor = BACKGROUNDCOLOR;
    _sectionView2.label.text = @"点数兑换";
    _sectionView2.imageV.hidden = YES;
    _sectionView2.label.backgroundColor = [UIColor clearColor];
}

- (void)creatScoreHistory
{
    self.score = [[[NSBundle mainBundle] loadNibNamed:@"ScoreHistoryView" owner:nil options:nil] lastObject];
    _score.frame = CGRectMake(0, 40, KSCREENWIDTH, 320);
//    _score.backgroundColor = [UIColor redColor];
    [self.view addSubview:_score];
}

- (void)creatScoreExchange
{
    self.exchange = [[[NSBundle mainBundle] loadNibNamed:@"ScoreExchangeView" owner:nil options:nil] lastObject];
    _exchange.frame = CGRectMake(0, 350, KSCREENWIDTH, 260);
    _exchange.ExchangButton.layer.cornerRadius = 20;
    _exchange.ExchangButton.layer.masksToBounds = YES;
    //    _score.backgroundColor = [UIColor redColor];
    [self.view addSubview:_exchange];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
